package com.gateway.plugin.springcloud.context;

import com.gateway.common.enums.PluginEnum;
import com.gateway.common.enums.RpcTypeEnum;
import com.gateway.plugin.api.context.GatewayContext;
import com.gateway.plugin.api.context.GatewayContextDecorator;

/**
 * @program: api-gateway
 * @description:
 * @author: YuKai Fan
 * @create: 2025/2/6 15:49
 **/
public class SpringCloudGatewayContextDecorator implements GatewayContextDecorator {
    @Override
    public GatewayContext decorator(GatewayContext gatewayContext) {
        gatewayContext.setRpcType(RpcTypeEnum.SPRING_CLOUD);
        gatewayContext.setModule(String.format("%s-%s", PluginEnum.DIVIDE.getName(), gatewayContext.getRpcType()));
        return gatewayContext;
    }
}
